<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="keywords" content="">
  <meta name="description" content="">
  <title>字典树列表</title>
  <link href="/static/css/bootstrap.min.css" rel="stylesheet"/>
  <link rel="stylesheet" href="/static/include/css/style.css">
  <link href="/static/ajax/libs/jquery-ztree/3.5/css/metro/zTreeStyle.css" rel="stylesheet"/>
</head>
<style>
  body {
    height: auto;
    font-family: "Microsoft YaHei";
  }

  button {
    font-family: "SimSun", "Helvetica Neue", Helvetica, Arial;
  }
</style>
<body class="hold-transition box box-main">
<input id="columnId" type="hidden"/>
<!--<input id="treeId" type="hidden" th:value="${dict?.id}"/>-->
<input id="dictType" type="hidden"/>
<div class="wrapper">
  <div class="treeShowHideButton" onclick="$.tree.toggleSearch();">
    <label id="btnShow" title="显示搜索" style="display:none;">︾</label>
    <label id="btnHide" title="隐藏搜索">︽</label>
  </div>
  <div class="treeSearchInput" id="search">
    <label for="keyword">关键字：</label><input type="text" class="empty" id="keyword" maxlength="50">
    <button class="btn" id="btn" onclick="$.tree.searchNode()"> 搜索</button>
  </div>
  <div id="tree" class="ztree treeselect"></div>
</div>
<script src="/static/include/js/footer.js"></script>
<script src="/static/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js"></script>
<script>
  $(function () {
    $('#columnId').val(getQueryString('id'))
    $("#dictType").val(getQueryString('type'));
    var url = api + "/admin/dict/treeData";
    var options = {
      url: url,
      onClick: zOnClick
    };
    $.tree.init(options);
  });

  function zOnClick(event, treeId, treeNode) {
    $("#dictType").val(treeNode.title);
  }
</script>
</body>
</html>
